package com.rd.student.jike.class2.lihongming.week731_806.Day0731;

import java.util.LinkedList;

/**
 * @Auther:Heinrich
 * @Date:2023/7/31-07-31-15:35
 * @Description:c230731.test
 * @version:1.0
 */
public class test05 {
    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        for (int i = 0; i < 20; i++) {
            int a = (int) (Math.random()*50);
            if (!list.contains(a)) {
                list.add(a);
            }else{
                i--;
            }
        }
        System.out.println(list);
    }
}
